package com.qf.Utils;

import java.util.concurrent.*;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 你的名字
 * @Date: 2021/08/03/14:05
 * @Description:线程池
 */
public class ExecutorUtils {
    private static ThreadPoolExecutor executor=null;
    static {
        new ThreadPoolExecutor(
                10,//核心线程
                20,//最大线程
                2,//存活时间
                TimeUnit.MINUTES,//时间单位
                new LinkedBlockingQueue<>(10000),//队列
                Executors.defaultThreadFactory(),//线程工厂
                new ThreadPoolExecutor.AbortPolicy()//拒绝策略
        );
    }
    public static ThreadPoolExecutor getExcutorsPool() {
        return executor;
    }
}
